package com.yykj.user.center.server.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author chenl
 * @version 1.0
 * @date 2021/11/4 17:00
 */
public class OrderUtil {

    public static synchronized String getOrderNo(Integer hospitalId,Integer type){
        String orderNo = String.valueOf(hospitalId)+type+getDateTime();
        return orderNo;
    }

    /**
     * 生成时间戳
     */
    private static String getDateTime() {
        DateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        return sdf.format(new Date());
    }

}
